<?php

require "include/bittorrent.php";
dbconn(false);
loggedinorreturn();
if (empty($_POST['opt'])) {
	stderr('愚蠢的人类啊！', '请输入押注数量');
}
if ($CURUSER < UC_MODERATOR && $CURUSER['id'] != $betsadmin)
	stderr("错误", "权限不足");
$id = isset($_POST['id']) && is_valid_id($_POST['id']) ? $_POST['id'] : 0;
$text = htmlspecialchars($_POST['opt'], ENT_QUOTES);
sql_query("INSERT INTO betoptions(gameid,text) VALUES(" . sqlesc($id) . "," . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
header("location: bet_opt.php?id=" . $id . "");
